home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8068 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news.telalink.net!news
  2. From: daver@nashville.net (David Rawle)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: [Q] Newbie problem with inheritance (PLEASE HELP!)
  5. Date: 14 Feb 1996 06:10:32 GMT
  6. Organization: Telalink Corporation, Nashville, TN, USA
  7. Message-ID: <4fruco$73t@adam.telalink.net>
  8. References: <31202EA3.1617@iglou.com>
  9. NNTP-Posting-Host: nash-pm1-a25.telalink.net
  10. Mime-Version: 1.0
  11. X-Newsreader: WinVN 0.99.3
  12.  
  13. In article <31202EA3.1617@iglou.com>, panther@iglou.com says...
  14. >
  15. >Let me see if I have this correct...  in BC++ 4.51-
  16. >
  17. >In public inheritance public members stay public, protected members stay
  18. >protected, and the private members are NOT inherited to the derived 
  19. class.
  20. >
  21. >In protected inheritance, public members turn to protected members, and
  22. >protected members turn to private members, and private members of the
  23. >base class are NOT inherited to the derived class.
  24. >
  25. >In private inheritance, public and protected members become private 
  26. members,
  27. >and private members are NOT inherited to the derived class.
  28. >
  29. >        I have been going crazy over this codeI am writing for about a 
  30. week
  31. >and would really appriciate if somebody would take a minute out of their 
  32. day
  33. >to help me out.  I will send the code to whoever will help...  thanks in
  34. >advance!
  35. >
  36. >Abe L. Getchell
  37.  
  38. public, protected, and private control ACCESS to inherited members.
  39. Think of public as an open door, protected as a locked door (but
  40. descendants have a key), and pivate as a locked door with the key
  41. on the inside. When you inherit, you place the room (object) inside
  42. another room (object).  You can lock the new door by labeling it
  43. protected or private, but can never unlock any private doors inside.
  44.  
  45. This isn't a wonderful analogy, but I hope it helps.
  46.  
  47. Daver
  48.  
  49.